13750 IF ERR=58 THEN KILL TEMPFILE$:RESUME ELSE ON ERROR GOTO 0:GOTO 13350
13800 IF NOFILE=1 THEN PRINT:PRINT "You cannot add to a file unless there is already a file on the disk. Run the" ELSE 14000
13850 PRINT "program again making the correct selections or correct the problem with your
13900 PRINT "disk files.
13950 CLOSE:KEY ON:END
14000 IF EOF(1) THEN CLOSE #1:GOTO 14700
14050 INPUT #1,DAT$
14100 FOR N=1 TO 4
14150 INPUT #1,DUMP
14200 NEXT N
14250 GOTO 14000
14300 CLOSE #1
14350 PRINT:PRINT "To start a securities data file, enter a file name (up to eight characters, no
14400 PRINT "extension. The extension shown below will be added to identify the file.
14450 IF C=4 THEN PRINT:PRINT "NOTE: To work with the program PLTSTKFL, the last two characters of an options data filename must be the strike price of the option.
15150 PRINT "To skip a date (holiday) enter 8888."
15200 PRINT "To repeat a date (error recovery) enter 7777."
15250 PRINT "If there is no data for an entry (no trades) press <enter> to skip through.":PRINT
15300 D=D+1
15350 GOSUB 20450'datgen
15400 IF DATINC=1 THEN GOSUB 20950: GOSUB 20450
15450 IF B=1 AND ATE$=FIRSTDATE$ THEN PRINT "START OF OLD DATA!":PRINT:PRINT "...Old data is being transferred from " TEMPFILE$ " to " FILESPEC$ ".":GOTO 18350
15500 GOSUB 21350'monthnam
15550 GOSUB 19850'dayname
15600 FOR WKDY=1 TO 7:IF DAYNAME$=DAYSKIP$(WKDY) THEN 15300
16950 GOSUB 18100:IF INT(AA)<>AA THEN BEEP:PRINT "VOLUME must be an integer!":GOTO 16900
17000 INPUT "BID "; BB
17050 GOSUB 18100
17100 INPUT "ASKED "; CC
17150 GOSUB 18100:IF BB>CC THEN BEEP:PRINT "BID is greater than ASKED!":GOTO 17100
17200 IF (CC-BB)>0.25*BB THEN BEEP:PRINT "Day's trading range is greater than 25%! Press <enter> to input this value, or press any other key to reenter day's price data.":GOTO 17300
17250 GOTO 18050
17300 X$=INKEY$: IF X$="" THEN 17300 ELSE IF X$=CHR$(13) THEN 17250 ELSE 17000
17850 GOSUB 18100:IF BB>CC THEN BEEP:PRINT "NAV is greater than OFFER!":GOTO 17800
17900 IF (CC-BB)>0.25*BB THEN BEEP:PRINT "Day's trading range is greater than 25%! Press <enter> to input this value, or press any other key to reenter day's data.":GOTO 18000
17950 GOTO 18050
18000 X$=INKEY$: IF X$="" THEN 18000 ELSE IF X$=CHR$(13) THEN 17950 ELSE 17700
18050 WRITE#1,ATE$,AA,BB,CC,DD:IF B=7 THEN CLOSE #1:GOTO 27000 ELSE 15300
18100 IF AA=9999 OR BB=9999 OR CC=9999 OR DD=9999 THEN AA=0:BB=0:CC=0:DD=0:RETURN 18300
18150 IF AA=8888 OR BB=8888 OR CC=8888 OR DD=8888 THEN AA=0:BB=0:CC=0:DD=0:RETURN 15300
18200 IF AA=7777 OR BB=7777 OR CC=7777 OR DD=7777 THEN AA=0:BB=0:CC=0:DD=0:RETURN 15700
18250 RETURN
18300 CLOSE:KEY ON:END
18350 ON ERROR GOTO 18850
18400 OPEN TEMPFILE$ FOR INPUT AS #2
18450 IF EOF(2) THEN 19300
18500 INPUT #2, DAT$
18550 Z100$=DATE$
18600 DATE$=DAT$
18650 DAT$=DATE$:DATE$=Z100$
18700 INPUT #2,AA,BB,CC,DD
18750 WRITE #1,DAT$,AA,BB,CC,DD
18800 GOTO 18450
18850 IF ERL=18350 THEN 23050
18900 IF ERL=18550 THEN PRINT:PRINT "THERE IS AN ERROR IN READING THE FILE " TEMPFILE$ ". CHECK THIS FILE WITH EDLIN." ELSE 19100
18950 PRINT " THIS PROGRAM WILL END WITH YOUR NEW DATA IN " FILESPEC$ " AND YOUR OLD FILE "
19000 PRINT " IN " TEMPFILE$ "."
19050 CLOSE #1, #2: KEY ON:ON ERROR GOTO 0:END
19100 IF ERL=17000 THEN PRINT:PRINT "THERE IS AN ERROR IN READING FROM " TEMPFILE ". YOUR NEW DATA WITH SOME OF THE" ELSE 19300
19150 PRINT "OLD DATA APPENDED WILL BE FOUND IN " FILESPEC$ ". YOUR OLD FILE " TEMPFILE$
19200 PRINT "SHOULD BE INTACT. USE EDLIN TO CHECK IT, THEN RENAME IT AND START OVER."
19250 CLOSE #1, #2: KEY ON:ON ERROR GOTO 0:END
19300 PRINT:PRINT "YOUR NEW DATA WITH THE OLD DATA APPENDED WILL BE FOUND IN " FILESPEC$
19350 PRINT:PRINT "CHECK THIS FILE WITH EDLIN. THE FILE " TEMPFILE$ " WILL BE WRITTEN OVER "
19400 PRINT:PRINT "ONLY WHEN YOU DO ANOTHER INSERT OPERATION ON " FILENAME$ "."
19450 CLOSE #1, #2: KEY ON:ON ERROR GOTO 0:END
19500 Y=VAL(RIGHT$(DAT$,4))' --
19550 D=VAL(MID$(DAT$,4,2))' dat$ as mm-dd-yyyy | subroutine
19600 M=VAL(LEFT$(DAT$, 2))' to M,D,Y,M$,D$,Y$ | to
20550 M$=RIGHT$(M$,2):D$=RIGHT$(D$,2):Y$=RIGHT$(Y$,4)' | to
20600 ATE$=M$+"-"+D$+"-"+Y$' | form
20650 ON ERROR GOTO 20850' Converts M,D, & Y integers | and
20700 DATE$=ATE$' into ATE$ in form mm-dd-yyyy | check
20750 ON ERROR GOTO 0' and M$,D$, & Y$ as mm, dd, & yyyy. | a
20800 DATE$=Z4000$:RETURN' If invalid date, returns DATINC = 1.| standard
20850 IF ERR=5 THEN DATINC=1 ELSE PRINT "DATGEN TROUBLE":STOP' |date format
20900 RESUME 20750' --
20950 D=1:M=M+1:YEARLIM=0' --
21000 IF M=13 THEN 21100' Uses M, D, & Y. | subroutine
21050 RETURN' Assumes end of old month. | for
21100 M=1:Y=Y+1' Returns D=1,M+1,Y+1 as needed. | incrementing
21150 IF Y>=2099 THEN 21250' If Y exceeds 2099, | a
21200 RETURN' returns: YEARLIM = 1 | date
21250 PRINT "Cannot go beyond year 2099"' | by
21300 YEARLIM=1:RETURN' -- one month
21350 ON M GOTO 21400,21450,21500,21550,21600,21650,21700,21750,21800,21850,21900,21950
21400 MONTHNAME$="JAN.":RETURN'
21450 MONTHNAME$="FEB.":RETURN'
21500 MONTHNAME$="MAR.":RETURN'
21550 MONTHNAME$="APR.":RETURN' Subroutine that returns
21600 MONTHNAME$="MAY.":RETURN'
21650 MONTHNAME$="JUN.":RETURN' a name for
21700 MONTHNAME$="JUL.":RETURN'
21750 MONTHNAME$="AUG.":RETURN' the month numbered M.
21800 MONTHNAME$="SEP.":RETURN'
21850 MONTHNAME$="0CT.":RETURN'
21900 MONTHNAME$="NOV.":RETURN'
21950 MONTHNAME$="DEC.":RETURN'
22000 '-----------GETFILE------subroutine to specify a file for use----------
22050 ON ERROR GOTO 22550:NOFILE=0
22100 PRINT:PRINT "The following files are on the disk.":FILES "*"+EXT$
22150 ON ERROR GOTO 0
22200 IF B=3 THEN RETURN 14500
22250 PRINT:PRINT "What is the filename of the one you want to use":INPUT "(if none type NONE)";FILENAME$
22300 IF FILENAME$="NONE" OR FILENAME$="none" OR FILENAME$="None" THEN NOFILE=1:RETURN
22350 FILESPEC$=FILENAME$+EXT$
22400 ON ERROR GOTO 22650:OPEN FILESPEC$ FOR INPUT AS #1
22450 IF B=3 THEN PRINT "There already is a file with this name on the disk. Entering data will change it. Press <Ctrl>+<Break> now to quit if this is a mistake.":CLOSE #1
22500 ON ERROR GOTO 0:RETURN
22550 IF ERR=53 THEN 22600 ELSE PRINT "GETFILE TROUBLE":STOP
22600 PRINT "There are no files for this security on this disk.":NOFILE=1:RESUME 22500
22650 IF ERR = 52 THEN PRINT "That is not a correct filespec, try again":RESUME 22150
22700 IF ERR = 62 THEN PRINT "Bad file data. You are trying to read from the wrong file. Try again.":RESUME 22050
22750 IF ERR = 53 THEN 22800 ELSE PRINT "GETFILE TROUBLE":STOP
22800 PRINT "The disk is clear of files by that name.":NOFILE=1:RESUME 22500
22850 '---------MAKFILE------opens a file for appending data----------------
22900 ON ERROR GOTO 23050' disk error subroutine DSKERROR
22950 OPEN FILESPEC$ FOR APPEND AS #1
23000 ON ERROR GOTO 0:RETURN
23050 IF ERR=24 THEN PRINT "No disk in drive? Device timeout.":GOTO 23600
23100 IF ERR=52 THEN PRINT "Bad file name. ";:INPUT "Try entering the complete filespec (with extension).";FILESPEC$:RESUME
23150 IF ERR=57 THEN PRINT "I/O error. Try another disk.":GOTO 23600
23200 IF ERR=61 THEN PRINT "Disk full. Try another disk.":GOTO 23600
23250 IF ERR=64 THEN PRINT "Bad file name. ";:INPUT "Try entering the complete filespec (with extension).";FILESPEC$:RESUME
23300 IF ERR=67 THEN PRINT "Too many files in directory. Try another disk to temoroarily save your data.":GOTO 23600
23350 IF ERR=68 THEN PRINT "Disk drive unavailable.":GOTO 23600
23400 IF ERR=70 THEN PRINT "You have write protected this disk!":GOTO 23600
23450 IF ERR=71 THEN PRINT "No disk in drive or door not closed.":GOTO 23600
23500 IF ERR=72 THEN PRINT "Disk Media Error. Try another disk.":GOTO 23600
23550 PRINT:PRINT "DISK PROBLEM ";:CLOSE:ON ERROR GOTO 0:END
23600 PRINT "Program will continue when problem is corrected.":LOCATE CSRLIN-2,1:RESUME
23900 ON ERROR GOTO 0' date format (mm-dd-yyyy) | and
23950 DAT$=DATE$:DATE$=Z1000$' and returns it as DAT$ | check
24000 RETURN' | the
24050 IF ERR=5 THEN 24100 ELSE PRINT "DATCHECK TROUBLE":STOP' | date
24100 PRINT "Not a valid date. Try again.":RESUME 23750' --
24150 '---------------list a data file on the printer-----------------------
24200 ON ERROR GOTO 24350:LPRINT CHR$(27)CHR$(64)CHR$(14)CHR$(15)CHR$(27)CHR$(48)CHR$(27)CHR$(67)CHR$(0)CHR$(11)CHR$(27)CHR$(68)CHR$(20)CHR$(40)CHR$(60)CHR$(80)CHR$(100)CHR$(120)CHR$(0);:ON ERROR GOTO 0
24250 LPRINT "Listing of the file "FILESPEC$" on "DATE$" at "TIME$"."
24300 ON C GOTO 24400,24900,25400,25900,26400
24350 IF ERR=24 OR ERR=25 OR ERR=27 THEN BEEP:PRINT:PRINT "PRINTER NOT READY!...Program will resume when problem is corrected.":RESUME ELSE ON ERROR GOTO 0:GOTO 13350